import 'dart:convert' show json;

class PeidBean {

  List<PdUser> list;

  PeidBean.fromParams({this.list});

  factory PeidBean(jsonStr) => jsonStr == null ? null : jsonStr is String ? PeidBean.fromJson(json.decode(jsonStr)) : PeidBean.fromJson(jsonStr);

  PeidBean.fromJson(jsonRes) {
    list = jsonRes == null ? null : [];

    for (var listItem in list == null ? [] : jsonRes){
      list.add(listItem == null ? null : PdUser.fromJson(listItem));
    }
  }

  @override
  String toString() {
    return '{"json_list": $list}';
  }
}

class PdUser {

  int price;
  int uid;
  int vip;
  String birth;
  String code;
  String country;
  String icon;
  String nickname;
  String signtext;
  String video;
  PdUser({this.price, this.uid, this.vip, this.birth, this.code, this.country, this.icon, this.nickname, this.signtext, this.video});

  PdUser.fromParams({this.price, this.uid, this.vip, this.birth, this.code, this.country, this.icon, this.nickname, this.signtext, this.video});

  PdUser.fromJson(jsonRes) {
    price = jsonRes['price'];
    uid = jsonRes['uid'];
    vip = jsonRes['vip'];
    birth = jsonRes['birth'];
    code = jsonRes['code'];
    country = jsonRes['country'];
    icon = jsonRes['icon'];
    nickname = jsonRes['nickname'];
    signtext = jsonRes['signtext'];
    video = jsonRes['video'];
  }

  @override
  String toString() {
    return '{"price": $price, "uid": $uid, "vip": $vip, "birth": ${birth != null?'${json.encode(birth)}':'null'}, "code": ${code != null?'${json.encode(code)}':'null'}, "country": ${country != null?'${json.encode(country)}':'null'}, "icon": ${icon != null?'${json.encode(icon)}':'null'}, "nickname": ${nickname != null?'${json.encode(nickname)}':'null'}, "signtext": ${signtext != null?'${json.encode(signtext)}':'null'}, "video": ${video != null?'${json.encode(video)}':'null'}}';
  }
}